package views;

import java.util.List;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

public class DependenciesLabelProvider extends LabelProvider implements ITableLabelProvider {

	@Override
	public Image getColumnImage(Object arg0, int arg1) {
		switch (arg1) {
			case 0:return getImage(arg0);
			case 1:return null;
			default:return null;
		}
	}

	@Override
	public String getColumnText(Object arg0, int arg1) {
		switch (arg1) {
			case 0:return ((List<String>)arg0).get(1);
			case 1:return ((List<String>)arg0).get(2);//((ITask)arg0).isActive()?"active":"performed";
			case 2:return ((List<String>)arg0).get(3);
			case 3:return ((List<String>)arg0).get(4);
			case 4:return ((List<String>)arg0).get(5);
			default:return "";//return ((List<String>)arg0).get(2);
		}
	}
	
	@Override
	public Image getImage(Object element) {
		return PlatformUI.getWorkbench().
			getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT);
	}
	
	@Override
	public String getText(Object element) {
		return element.toString();
	}
	
}